package com.cssy.xxkj.logic.dao.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicWarehouseOtheroutDAO;
import com.cssy.xxkj.logic.entity.LogicWarehouseOtheroutDO;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-09-17
 */
public class LogicWarehouseOtheroutDAOImpl extends SqlMapClientDaoSupport implements LogicWarehouseOtheroutDAO {

    /**
     * 插入数据
     * @param logicWarehouseOtheroutDO
     * @return 插入数据的主键
     */
    public String insertLogicWarehouseOtheroutDO(LogicWarehouseOtheroutDO logicWarehouseOtheroutDO) {
        Object id = getSqlMapClientTemplate().insert("LogicWarehouseOtherout.insert", logicWarehouseOtheroutDO);
        return (String) id;
    }

    /**
     * 统计记录数
     * @param logicWarehouseOtheroutDO
     * @return 查出的记录数
     */
    public Integer countLogicWarehouseOtheroutDOByExample(LogicWarehouseOtheroutDO logicWarehouseOtheroutDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtherout.countByDOExample", logicWarehouseOtheroutDO);
        return count;
    }

    /**
     * 更新记录
     * @param logicWarehouseOtheroutDO
     * @return 受影响的行数
     */
    public Integer updateLogicWarehouseOtheroutDO(LogicWarehouseOtheroutDO logicWarehouseOtheroutDO) {
        int result = getSqlMapClientTemplate().update("LogicWarehouseOtherout.update", logicWarehouseOtheroutDO);
        return result;
    }

    /**
     * 获取对象列表
     * @param logicWarehouseOtheroutDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicWarehouseOtheroutDO> findListByExample(LogicWarehouseOtheroutDO logicWarehouseOtheroutDO) {
        List<LogicWarehouseOtheroutDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtherout.findListByDO", logicWarehouseOtheroutDO);
        return list;
    }

    /**
     * 根据主键获取logicWarehouseOtheroutDO
     * @param id
     * @return logicWarehouseOtheroutDO
     */
    public LogicWarehouseOtheroutDO findLogicWarehouseOtheroutDOByPrimaryKey(String id) {
        LogicWarehouseOtheroutDO logicWarehouseOtheroutDO = (LogicWarehouseOtheroutDO) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtherout.findByPrimaryKey", id);
        return logicWarehouseOtheroutDO;
    }

    /**
     * 删除记录
     * @param id
     * @return 受影响的行数
     */
    public Integer deleteLogicWarehouseOtheroutDOByPrimaryKey(String id) {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("LogicWarehouseOtherout.deleteByPrimaryKey", id);
        return rows;
    }

	@Override
	public List<LogicWarehouseOtheroutDO> find(SearchConditions scs) throws DataAccessException {
		List<LogicWarehouseOtheroutDO> list = getSqlMapClientTemplate().queryForList("LogicWarehouseOtherout_ex.find", scs);
        return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtherout_ex.count", scs);
        return count;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicWarehouseOtherout_ex.deleteBizRemoved", id);
        return count;
	}

}